/*
 * SearchSNPForm.java
 *
 * Created on September 28, 2007, 12:28 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package ca.ubc.icapture.genapha.forms;

import icapture.SQLMgr;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author btripp
 */
public class SearchSNPForm   extends ActionForm {


    private String submitType;
 
    private String genes;    
    private String snps;
    private String chromosomes;
    
    private String selectedKegPathway;
    private ArrayList<String> availableKegPathways;

    
    public SearchSNPForm(){
        super();
        availableKegPathways = SQLMgr.getAvailableKegPathways();
        availableKegPathways.add(0, "");
    }
    public void reset(ActionMapping mapping, HttpServletRequest request) {

    }
    
    public ActionErrors validate( ActionMapping mapping, HttpServletRequest request ) {
        ActionErrors errors = new ActionErrors();
        if(submitType!=null && submitType.equalsIgnoreCase("Go")){
            if(snps==null || snps.length()==0){
                errors.add("snps",new ActionMessage("error.entry.required"));
            }
        }
        return errors;
    }

    

    /**
     * 
     * @return 
     */
    public String getSubmitType() {
        return submitType;
    }

    /**
     * 
     * @param submitType 
     */
    public void setSubmitType(String submitType) {
        this.submitType = submitType;
    }

    public String getGenes() {
        return genes;
    }

    public void setGenes(String genes) {
        this.genes = genes;
    }

    public String getSnps() {
        return snps;
    }

    public void setSnps(String snps) {
        this.snps = snps;
    }

    public String getChromosomes() {
        return chromosomes;
    }

    public void setChromosomes(String chromosomes) {
        this.chromosomes = chromosomes;
    }

    public String getSelectedKegPathway() {
        return selectedKegPathway;
    }

    public void setSelectedKegPathway(String selectedKegPathway) {
        this.selectedKegPathway = selectedKegPathway;
    }

    public ArrayList<String> getAvailableKegPathways() {
        return availableKegPathways;
    }

    public void setAvailableKegPathways(ArrayList<String> availableKegPathways) {
        this.availableKegPathways = availableKegPathways;
    }

}
